package com.ruoyi.points.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.ruoyi.fk.domain.QuestionBank;
import com.ruoyi.youyou.domain.SysYouYouUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单管理对象 order_info
 *
 * @author jion
 * @date 2025-08-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    //    一对yi
    private SysYouYouUser sysYouYouUser;
    private QuestionBank questionBank;
    /** 订单ID */
    private Integer id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Integer userId;

    /** 题库ID */
    @Excel(name = "题库ID")
    private Integer questionBankId;

    /** 订单编号 */
    @Excel(name = "订单编号")
    private String orderNo;

    /** 订单金额 */
    @Excel(name = "订单金额")
    private BigDecimal amount;

    /** 使用积分 */
    @Excel(name = "使用积分")
    private Integer points;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private String status;

    /** 支付时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /**
     * 关闭时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "关闭时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date closeTime;

    private Integer del;

    /**
     * 用户名（用于查询条件）
     */
    private String userName;

    /**
     * 题库名称（用于查询条件）
     */
    private String questionBankName;

    public QuestionBank getQuestionBank() {
        return questionBank;
    }

    public void setQuestionBank(QuestionBank questionBank) {
        this.questionBank = questionBank; // 必须有此 setter 方法
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public SysYouYouUser getSysYouYouUser() {
        return sysYouYouUser;
    }

    public void setSysYouYouUser(SysYouYouUser sysYouYouUser) {
        this.sysYouYouUser = sysYouYouUser;
    }

    public Integer getId()
    {
        return id;
    }

    public void setUserId(Integer userId)
    {
        this.userId = userId;
    }

    public Integer getUserId()
    {
        return userId;
    }

    public void setQuestionBankId(Integer questionBankId)
    {
        this.questionBankId = questionBankId;
    }

    public Integer getQuestionBankId()
    {
        return questionBankId;
    }

    public void setOrderNo(String orderNo)
    {
        this.orderNo = orderNo;
    }

    public String getOrderNo()
    {
        return orderNo;
    }

    public void setAmount(BigDecimal amount)
    {
        this.amount = amount;
    }

    public BigDecimal getAmount()
    {
        return amount;
    }

    public void setPoints(Integer points)
    {
        this.points = points;
    }

    public Integer getPoints()
    {
        return points;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public void setPayTime(Date payTime)
    {
        this.payTime = payTime;
    }

    public Date getPayTime()
    {
        return payTime;
    }

    public void setCloseTime(Date closeTime)
    {
        this.closeTime = closeTime;
    }

    public Date getCloseTime()
    {
        return closeTime;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getQuestionBankName() {
        return questionBankName;
    }

    public void setQuestionBankName(String questionBankName) {
        this.questionBankName = questionBankName;
    }
    public Integer getdel() {
        return del;
    }

    public void setdel(Integer del) {
        this.del = del;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("questionBankId", getQuestionBankId())
                .append("orderNo", getOrderNo())
                .append("amount", getAmount())
                .append("points", getPoints())
                .append("status", getStatus())
                .append("createTime", getCreateTime())
                .append("payTime", getPayTime())
                .append("closeTime", getCloseTime())
                .append("del",getdel())
                .toString();
    }
}
